﻿@using LunchList.ViewModels
@model GuestListViewModel

        <div class="row">
            <div class="col-lg-6">
                <div class="panel panel-default">
                    <!-- Default panel contents -->
                    <div class="panel-heading">@Model.EventName (@Model.EventDate.ToShortTimeString())</div>

                    <!-- Table -->
                    <table class="table table-striped">
                        <thead>
                            <tr>
                                <th>Name</th>
                            </tr>
                        </thead>
                        @{
                            Model.ModifyAction = "RSVP";
                        }
                        <tbody>

                            @foreach (GuestListItemViewModel guest in Model.GuestListGuests)
                            {
                                var trClass = "";
                                if (guest.GuestId == Model.CurrentUserGuestId)
                                {
                                    trClass = "success";
                                    Model.ModifyAction = "Delete RSVP";
                                }
                                <tr class="@trClass">
                                    <td>
                                        @guest.GuestName
                                    </td>
                                </tr>
                            }

                        </tbody>
                        
                    </table>
                </div>
            </div>
            <div class="col-lg-6 left">
                @Html.HiddenFor(m => m.GuestListGuests)
                @Html.HiddenFor(m => m.EventId)
                @Html.HiddenFor(m => m.EventDate)
                @Html.HiddenFor(m => m.EventName)
                @Html.HiddenFor(m => m.ModifyAction)

                    <button type="submit" class="btn btn-default btn-lg">
                    <span class="glyphicon glyphicon-envelope"></span> @Model.ModifyAction
                </button>
        
            
            </div>
        </div>
